package com.cby.android.base

import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.cby.android.base.accessibility.AccessibilityTestActivity
import com.cby.android.base.capture.ScreenCaptureActivity
import com.cby.android.base.aidl.ChildProcessActivity
import com.cby.android.base.contentprovider.ContentProviderActivity
import com.cby.android.base.handler.Handler2Activity
import com.cby.android.base.json.JsonTestActivity
import com.cby.android.base.kotlin.start
import com.cby.android.base.localsocket.MyLocalSocketServerActivity
import com.cby.android.base.net.NetDownloadActivity
import com.cby.android.base.vi.VoiceInteractionActivity
import com.cby.android.base.web.WebActivity

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
    }

    fun onHandleClick(view: View) {
        start(Handler2Activity::class.java)
    }

    fun onContentProviderClick(view: View) {
        start(ContentProviderActivity::class.java)
    }

    fun onAidlClick(view: android.view.View) {
        //添加这个Intent.FLAG_ACTIVITY_NEW_DOCUMENT，相当于多创建一个activity栈，多任务的时候会像微信小程序一样
        start(ChildProcessActivity::class.java, Intent.FLAG_ACTIVITY_NEW_DOCUMENT)
    }

    fun onWebClick(view: View) {
        start(WebActivity::class.java)
    }

    fun onJsonClick(view: View) {
        start(JsonTestActivity::class.java)
    }

    fun onLocalSocketClick(view: View) {
        start(MyLocalSocketServerActivity::class.java)
    }

    fun onAccessibilityClick(view: View) {
        start(AccessibilityTestActivity::class.java)
    }

    fun onScreenCaptureClick(view: View) {
        start(ScreenCaptureActivity::class.java)
    }

    fun onVoiceInteractionClick(view: View) {
        start(VoiceInteractionActivity::class.java)
    }

    fun onNetDownload(view: View) {
        start(NetDownloadActivity::class.java)
    }
}